package cn.tedu.test.luban.demo.config;

import cn.tedu.test.luban.demo.bean.Bean01;
import cn.tedu.test.luban.demo.selector.MySelector;
import org.springframework.context.annotation.*;

import java.util.Date;

@Configuration
@ComponentScan(basePackages = {
        "cn.tedu.test.luban.demo.bean",
        "cn.tedu.test.luban.demo.condition.config"})
//第一种用法: 直接导入想要加载的其它配置类
//@Import(MyConfiguration02.class)
//第二种用法: 导入选择器,可以一次性导入多个配置类
@Import(MySelector.class)
@PropertySource("jdbc.properties")
public class MyConfiguration01 {

    public MyConfiguration01(){
        System.out.println("MyConfiguration01配置类被容器加载...");
    }

    @Bean
    public Bean01 bean01(){
        return new Bean01();
    }

}
